<template>
  <div class="wizard-container">
    <nav class="step-nav">
      <div v-for="(step, index) in steps" 
           :key="index"
           :class="['step', { active: currentStep === index }]">
        <span class="step-number">{{ index + 1 }}</span>
        {{ step.title }}
      </div>
    </nav>

    <div class="step-content">
      <component 
        :is="steps[currentStep].component" 
        @complete="handleStepComplete"
        @back="currentStep--"
      />
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import CategorySelector from './CategorySelector.vue';
import AuthForm from './AuthForm.vue';
import PackageUpload from './PackageUpload.vue';

const steps = ref([
  { 
    title: '选择分类',
    component: CategorySelector 
  },
  { 
    title: '开发者认证',
    component: AuthForm 
  },
  { 
    title: '上传应用包',
    component: PackageUpload 
  }
]);

const currentStep = ref(0);

const handleStepComplete = () => {
  if (currentStep.value < steps.value.length - 1) {
    currentStep.value++;
  } else {
    // 提交完成处理
  }
};
</script>

<style scoped>
.wizard-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.step-nav {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 24px;
}

.step {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  color: #999;
}

.step.active {
  color: #1890ff;
  border-bottom: 2px solid #1890ff;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.active .step-number {
  background: #1890ff;
  color: white;
}
</style>